<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../js/axios.min.js"></script>
    <script type="text/javascript" src="../js/vue-router.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../css/animate.css">
    <style>
        .header {
            height: 100px;
            background-color: sandybrown;
        }
        
        h1 {
            margin: 0px;
            padding: 0px;
            font-size: 30px;
        }
        
        .hh {
            display: flex;
        }
        
        .left {
            background-color: green;
            width: 20%;
            height: 500px;
        }
        
        .main {
            background-color: blue;
            width: 80%;
            height: 500px;
        }
    </style>
</head>

<body>
    <div id="app" class="container">
        <router-view></router-view>
        <div class="hh">
            <router-view name="left"></router-view>
            <router-view name="main"></router-view>
        </div>
    </div>

    <script>
        var headerBox = {
            template: `<h1 class="header">header区域</h1>`
        }

        var leftBox = {
            template: `<h1 class="left">left区域</h1>`
        }

        var mainBox = {
            template: `<h1 class="main">main区域</h1>`
        }

        var routerObj = new VueRouter({
            routes: [{
                path: '/',
                components: {
                    'default': headerBox,
                    'left': leftBox,
                    'main': mainBox
                }
            }]
        });


        var vm = new Vue({
            el: '#app',
            data: {},
            methods: {},
            router: routerObj
        });
    </script>
</body>

</html>